package com.vivebest.utils.app.controller;

import com.vivebest.utils.chc.service.ConsulHealthCheckService;
import com.vivebest.utils.common.response.ResultBody;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * consul 健康检查
 * </p>
 *
 * @author zsk
 * @date 2020/8/5 下午8:10
 */
@RestController
@RequestMapping("/health")
public class ConsulHealthCheckController {

    @Autowired
    private ConsulHealthCheckService consulHealthCheckService;

    @GetMapping
    @ApiOperation("获取consul健康注册信息")
    public ResultBody fetchHealthCheckInfo() {
        return ResultBody.success(consulHealthCheckService.fetchHealthCheckInfo());
    }
}
